import os 

def isTextFile(fileName):
	if(fileName.find(".txt") != -1):
		return True
	return False

BASE_DIR = "topK"
FILES = ['bfreq_out','simpmi_out','sim_out','pmi_out']
COMMAND = "stats-computeConfInterval.pl "


for eachFile in FILES:
	print COMMAND+os.path.join(BASE_DIR,eachFile+"_top_1"+".txt")+" > "+eachFile+"_agg"
	os.system(COMMAND+os.path.join(BASE_DIR,eachFile+"_top_1"+".txt")+" >> "+eachFile+"_agg")

	for i in range(5,101,5):
		print COMMAND+os.path.join(BASE_DIR,eachFile+"_top_"+str(i)+".txt")+" >> "+eachFile+"_agg"
		os.system(COMMAND+os.path.join(BASE_DIR,eachFile+"_top_"+str(i)+".txt")+" >> "+eachFile+"_agg")